package com.example.springbootdemo.app.service.impl;

import com.example.springbootdemo.domin.entity.Course;
import com.example.springbootdemo.infra.mapper.CourseMapper;
import com.example.springbootdemo.app.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    private CourseMapper courseMapper;

    @Override
    public Course getCourse(Course course) {
        return courseMapper.getCourse(course);
    }

    @Override
    public void addCourse(Course course) {
        courseMapper.addCourse(course);
    }

    @Override
    public void updateCourse(Course course) {
        courseMapper.updateCourse(course);
    }

    @Override
    public void deleteCourse(Integer cno) {
        courseMapper.deleteCourse(cno);
    }

    @Override
    public List<Course> getAll() {
        return courseMapper.getAll();
    }
}
